package com.wteam.PoJo.VO;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 帖子表
 * </p>
 *
 * @author author
 * @since 2024-07-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_postwork")
@ApiModel(value = "Postwork对象", description = "帖子表")
public class PostworkDetialVO implements Serializable {

    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "帖子id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;



    @ApiModelProperty(value = "发布帖子者的用户id")
    private Long userId;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "正文")
    private String content;

    @ApiModelProperty(value = "点赞量")
    private Integer likes;

    @ApiModelProperty(value = "评论量")
    private Integer favs;

    @ApiModelProperty(value = "收藏量")
    private Integer comments;

    @ApiModelProperty(value = "图片")
    private String photo;

    @ApiModelProperty(value = "标签")
    private String tag;

    @ApiModelProperty(value = "发布时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT, select = false)
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE, select = false)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "发布帖子者的用户名")
    private String username;

    @ApiModelProperty(value = "发布帖子者的头像")
    private String avatar;

    @ApiModelProperty(value = "评论者信息")
    private List<CommentVO> commentVOS;
}
